package org.omg.GIOP;

//
// Helper class for : CharSeq4
//
// @author OpenORB Compiler
//
public class CharSeq4Helper {

	//
	// Insert CharSeq4 into an any
	// @param a an any
	// @param t CharSeq4 value
	//
	public static void insert(org.omg.CORBA.Any a, char[] t) {
		a.insert_Streamable(new org.omg.GIOP.CharSeq4Holder(t));
	}

	//
	// Extract CharSeq4 from an any
	// @param a an any
	// @return the extracted CharSeq4 value
	//
	public static char[] extract(org.omg.CORBA.Any a) {

		return read(a.create_input_stream());
	}

	//
	// Internal TypeCode value
	//
	private static org.omg.CORBA.TypeCode _tc = null;

	//
	// Return the CharSeq4 TypeCode
	// @return a TypeCode
	//
	public static org.omg.CORBA.TypeCode type() {
		if (_tc == null) {
			org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
			_tc = orb
					.create_alias_tc(id(), "CharSeq4", orb.create_array_tc(4,
							orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_char)));
		}
		return _tc;
	}

	//
	// Return the CharSeq4 IDL ID
	// @return an ID
	//
	public static String id() {
		return _id;
	}

	private final static String _id = "IDL:omg.org/GIOP/CharSeq4:1.0";

	//
	// Read CharSeq4 from a marshalled stream
	// @param istream the input stream
	// @return the readed CharSeq4 value
	//
	public static char[] read(org.omg.CORBA.portable.InputStream istream) {
		char[] new_one;
		{
			int size1 = 4;
			new_one = new char[size1];
			istream.read_char_array(new_one, 0, new_one.length);
		}

		return new_one;
	}

	//
	// Write CharSeq4 into a marshalled stream
	// @param ostream the output stream
	// @param value CharSeq4 value
	//
	public static void write(org.omg.CORBA.portable.OutputStream ostream,
			char[] value) {
		ostream.write_char_array(value, 0, value.length);
	}

}
